package com.kuang.controller;

import com.kuang.pojo.SystemDept;
import com.kuang.service.DepartmentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DepartmentController {

//    @Resource
//    DepartmentMapper departmentMapper;
    @Resource
    DepartmentService departmentService;

    // 查询全部部门
    @GetMapping("/getDepartments")
    public List<SystemDept> getDepartments(){
        return departmentService.getDepartments();
    }

    // 查询全部部门
    @GetMapping("/getDepartment/{id}")
    public SystemDept getDepartment(@PathVariable("id") String dept_id){
        return departmentService.getDepartment(dept_id);
    }

}
